package com.java.example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller
public class StudentController {

    private StudentService studentService;
    private StudentRepository studentRepository;

    @Autowired
    public StudentController(StudentService studentService,StudentRepository studentRepository) {
        this.studentService = studentService;
        this.studentRepository = studentRepository;
    }

    public StudentController(StudentService studentService) {
        this.studentService = studentService;
    }
    public void sayHi(){
        System.out.println("do student controller sayHi()");
        studentService.sayHi();
        studentRepository.sayHi();
    }
}
